//by 2014302580118 黄锁
package saveInDatabase;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Scanner;

import com.mysql.jdbc.Connection;
import com.mysql.jdbc.PreparedStatement;

public class test {
	static Connection conn = getConn();
	public static void main(String[] args) throws SQLException, IOException{
		selectNow(conn);
	}
	
	public static void selectNow(Connection conn){
		String sql = "select now() from song";
	    PreparedStatement pstmt;
	    try {
	        pstmt = (PreparedStatement)conn.prepareStatement(sql);
	        ResultSet rs = pstmt.executeQuery();
	        
	        while (rs.next()) {
	            String time=rs.getString(1);
	            System.out.println(time);
	        }
	    }catch (SQLException e) {
	        e.printStackTrace();
	    }
	}
}
